
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { FormLabel, FormInput } from 'react-native-elements';
export default class BookDetail extends Component<Props> {

    render() {
        if (this.props.selectedBook.name === '') {
            return (
                <View></View>
            );
        }
        else {
            return (
                <View>
                    <Text style={styles.welcome}>图书：{this.props.selectedBook.name.toUpperCase()}</Text>
                    <FormLabel>图书ID：{this.props.selectedBook.id}</FormLabel>
                    <FormInput value={this.props.selectedBook.name} onChangeText={this.props.onInputChange}></FormInput>
                </View>

            );
        }

    }

}

const styles = StyleSheet.create({
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    }
});